package com.zzh.sl.empty;

import android.widget.Adapter;

import com.zzh.sl.ICountAdapter;

public class AdapterEmptyStrategy extends SourceCountEmptyStrategy<Adapter> {
    public AdapterEmptyStrategy(Adapter source) {
        super(source);
    }

    public AdapterEmptyStrategy(Adapter source, int emptyCount) {
        super(source, emptyCount);
    }

    @Override
    protected int getCount() {
        Adapter adapter = getSource();
        if (adapter instanceof ICountAdapter) {
            return ((ICountAdapter) adapter).getItemRealCount();
        }
        return adapter.getCount();
    }
}
